1. Technical Field
The present invention relates generally to improved data processing system, and in particular to an improved method and apparatus for monitoring performance of a data processing system. Still more particularly, present invention provides an improved method and apparatus for structured profiling of the data processing system and applications executing within the data processing system.
2. Description of Related Art
In analyzing and enhancing performance of a data processing system and the applications executing within the data processing system, it is helpful to know which software modules within a data processing system are using system resources. Effective management and enhancement of data processing systems requires knowing how and when various system resources are being used. Performance tools are used to monitor and examine a data processing system to determine resource consumption as various software applications are executing within the data processing system. For example, a performance tool may identify the most frequently executed modules and instructions in a data processing system, or may identify those modules which allocate the largest amount of memory or perform the most I/O requests. Hardware performance tools may be built into the system or added at a later point in time. Software performance tools also are useful in data processing systems, such as personal computer systems, which typically do not contain many, if any, built-in hardware performance tools.
One known software performance tool is a trace tool, which keeps track of particular sequences of instructions by logging certain events as they occur. For example, a trace tool may log every entry into and every exit from a module, subroutine, method, function, or system component. Alternately, a trace tool may log the requestor and the amounts of memory allocated for each memory allocation request. Typically, a time stamped record is produced for each such event. Pairs of records similar to entry-exit records also are used to trace execution of arbitrary code segments, to record requesting and releasing locks, starting and completing I/O or data transmission, and for many other events of interest.
Another tool used involves program sampling to identify events, such as program hot spots. This technique is based on the idea of interrupting the application or data processing system execution at regular intervals. At each interruption, the program counter of the currently executing thread, a process that is part of a larger process or program, is recorded. Typically, at post processing time, these tools capture values that are resolved against a load map and symbol table information for the data processing system and a profile of where the time is being spent is obtained from this analysis.
Event based profiling has drawbacks. For example, event based profiling is expensive in terms of performance (an event per entry, per exit), which can and often does perturb the resulting view of performance. Additionally, this technique is not always available because it requires the static or dynamic insertion of entry/exit events into the code. This insertion of events is sometimes not possible or is at least, difficult. For example, if source code is unavailable for the to-be-instrumented code, event based profiling may not be feasible.
On the other hand, sample based profiling provides a view of system performance (a "flat view"), but does provide the benefits of reduced cost and reduced dependence on hooking-capability.
Further, sample-based techniques do not identify where the time is spent in many small and seemingly unrelated functions, or in situations where no clear hot spot is apparent. Without an understanding of the program structure, it is not clear with such a "flat" profile how to determine where the performance improvements can be obtained.
Therefore, it would be advantageous to have an improved method and apparatus for profiling data processing systems and the applications executing within the data processing systems.